import Api from "./request";

// 用户登录
export const loginApi = (data) => Api.post("/login", data);

// 获取所有用户信息
export const getUserListApi = (params) => Api.get("/user/all", params);

// 更新用户信息
export const putUserAdminApi = (data) => Api.put("/user/admin", data);

// 添加新用户
export const postUserAdminApi = (data) => Api.post("/user/admin", data);

// 删除用户
export const deleteUserAdminApi = (data) => Api.delete("/user/admin", data);

// 查询好友列表
export const getFriendListApi = (data) =>
  Api.get(`/user/friend/all/${data.id}`);

// 查询关注列表
export const getFollowListApi = (data) =>
  Api.get(`/user/following/all/${data.id}`);

// 查询粉丝列表
export const getFansListApi = (data) => Api.get(`/user/fans/all/${data.id}`);

// 移除粉丝
export const deleteFansApi = (data) =>
  Api.delete(
    `/user/fans/remove?userId=${data.userId}&removeId=${data.removeId}`
  );

// 移除关注
export const deleteFollowingApi = (data) =>
  Api.delete(
    `/user/following/remove?userId=${data.userId}&removeId=${data.removeId}`
  );

// 获取两人的聊天记录
export const getUserChatLogApi = (data) => Api.get(`/user/chat/log`, data);

// 删除聊天记录
export const deleteUserChatLogApi = (data) =>
  Api.delete(`/user/chat/log/${data.id}`);
